<template>
    <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect" :active-text-color="'#409EFF'" :text-color="'#79BBFF'" router>
      <el-menu-item  index="/index">我的博客</el-menu-item>
      <el-menu-item @click="gotoHome">后台管理中心</el-menu-item>
    </el-menu>
</template>

<script>
export default {
  name: "myElMenu",
  data() {
    return {
      activeIndex: ''
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      this.activeIndex = key;
      console.log(key, keyPath);
    },
    gotoHome(){
      let routeUrl = this.$router.resolve({
        path: "/home",
      });
      window.open(routeUrl.href, '_blank');
    }
  }
}
</script>

<style scoped>


</style>
